<% active_record_attrs = @controller_name.singularize.constantize.attribute_names.delete_if { |item| ['id','created_at','updated_at'].include? item} rescue [] -%>
<%%= semantic_form_for @<%= @controller_file_name.singularize %>, :url => url_for(:action => params[:action] == 'new' ? :create : :update) do |f| %>
    <%%= f.inputs do %>
    <% active_record_attrs.each do |attribute| -%>
    <%%= f.input :<%= attribute %> %>
    <% end -%>
<%% end %>
    <%%= f.actions do %>
        <%%= f.action :submit, :as => :button,:label => '确定', :button_html => {class: 'btn btn-primary'} %>
        <%%= f.action :cancel, :as => :link,:label => '取消',:button_html => {class: 'btn btn-default'} %>
    <%% end %>
<%% end %>